package com.bb.blog.code.spring.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;

@Configuration
@Aspect
public class AopConfig {
    Logger logger = LoggerFactory.getLogger(AopConfig.class);
    @Pointcut("execution(public * com.bb.blog.code.spring.Test2.sout())")
    void pointCut() {
    }
    @Pointcut("execution(public * com.bb.blog.code.spring.Test2.sout2())")
    void pointCut2(){}


    @After("pointCut()")
    void after() {
        logger.info("aopConfig =============>   after method");
    }

    @Before("pointCut()")
    void before() {
        logger.info("aopConfig =============>   before method");
    }

    @Before("pointCut2()")
    void before2(){
        logger.info("aopConfig =======》 before method");
    }
}
